package com.jml.并行计算;


/**
 * @author:jml
 * @date: 2019/6/20 0020 22:31
 * @description：
 */
public class PStreamMain {

    //计算(B+C)*B/2
    public static void main(String[] args) {
        //计算   x = (B+C)
        new Thread(new Plus()).start();
        //计算   y = x*B
        new Thread(new Multiply()).start();
        //计算   z = y/2
        new Thread(new Div()).start();

        for (int i = 1; i <= 1000; i++) {
            for (int j = 1; j <= 1000; j++) {
                Msg msg = new Msg();
                msg.i = i;
                msg.j = j;
                msg.orgStr = "((" + i + "+" + j + ")*" + i + ")/2";
                Plus.bq.add(msg);
            }
        }
    }
}
